<template>
  <div>
    我是爷爷组件{{ name }}
    <Son />
    <div><button @click="name = '胖鸡'">修改name</button></div>
    <div><button @click="age = '88'">修改age</button></div>
  </div>
</template>

<script>
import { provide, ref } from "vue";
import Son from "./10-son.vue";
export default {
  components: {
    Son,
  },
  setup() {
    const name = "BraveY";
    provide("name", name);
    // 声明一个响应式数据
    const age = ref(18);
    provide("age", age);
    return {
      name,
      age,
    };
  },
};
</script>

<style>
</style>